package com.example.demo.dao;

import com.example.demo.pojo.Backgrounduser;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface BackgrounduserDao {

    //根据后台用户主键删除后台用户
    int deleteByPrimaryKey(Integer backgrounduserid);

    int insert(Backgrounduser record);

    //新增后台用户
    int insertSelective(Backgrounduser record);

    //根据主键查询
    Backgrounduser selectByPrimaryKey(Integer backgrounduserid);

    //根据账号查询
    @Select("select backgrounduserid from backgrounduser where accountNumber=#{accountNumber}")
    Backgrounduser selectByName(@Param("accountNumber") String accountNumber);

    //根据主键修改后台用户
    int updateByPrimaryKeySelective(Backgrounduser record);

    int updateByPrimaryKey(Backgrounduser record);

    //查询所有后台用户
    @Select("select * from backgrounduser")
    List<Backgrounduser> selectBackgroundUser();

    //分页查询
    @Select("select * from backgrounduser")
    Page<Backgrounduser> select();

    //根据账号查询
    @Select("select * from backgrounduser where accountNumber=#{accountNumber}")
    Backgrounduser selectByaccountNumber(String accountNumber);
}